/*
 * @Description:
 * @version:
 * @Author: 周子尧
 * @Date: 2021-09-09 17:00:26
 * @LastEditors: 周子尧
 * @LastEditTime: 2021-09-10 16:23:05
 */
const MANDALA_THEME_USER_CONFIG = 'MANDALA_THEME_USER_CONFIG';
export const loadFromLocal = (key) => {
  return new window.Promise((resolve) => {
    chrome.storage.local.get([key], (result) => {
      resolve(result[key]);
    });
  });
};
export const saveToLocal = (key, value) => {
  chrome.storage.local.set({[key]: value});
};

export const loadUserThemeFromLocal = () => {
  return loadFromLocal(MANDALA_THEME_USER_CONFIG);
};
export const saveUserThemeToLocal = (value) => {
  saveToLocal(MANDALA_THEME_USER_CONFIG, value);
};
